home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
c
/
ppl4c.exe
/
XYSAY.C
< prev
Wrap
Text File
|
1992-08-23
|
4KB
|
162 lines
/* xySay.c */
#include <stdio.h>
#include "ppl4c.h"
int xySayError(Code)
int Code; /* error code returned from xyDriver */
{
switch(Code)
{case NO_ERROR:
printf("No error.");
break;
case ALREADY_ACTIVE_ERROR:
printf("Already active.");
break;
case CANNOT_OPEN_ERROR:
printf("Cannot open file.");
break;
case EMPTY_FILE_ERROR:
printf("File is empty.");
break;
case NO_STARTUP_CHAR_ERROR:
printf("Expected startup character (NAK,'C','G') not received.");
break;
case NOT_NCG_ERROR:
printf("Startup character was not NAK, 'C', or 'G'.");
break;
case DISK_READ_ERROR:
printf("Disk read error.");
break;
case NO_EOT_ACK_ERROR:
printf("Expected EOT character not received.");
break;
case INTERNAL_ERROR:
printf("Internal error.");
break;
case CANCELLED_ERROR:
printf("Cancelled by other end.");
break;
case OUT_OF_SYNC_ERROR:
printf("Out of sync.");
break;
case RETRIES_ERROR:
printf("Retry limit exceeded.");
break;
case BAD_PACKET_NBR_ERROR:
printf("Bad packet number.");
break;
case TIMED_OUT_ERROR:
printf("Timed out awiting incoming character.");
break;
case NO_SUCH_FILE_ERROR:
printf("No such file.");
break;
default:
printf("Unknown error = %d\n",Code);
break;
} /* end switch */
return(0);
} /* end xySayError */
int xySayState(Code)
int Code; /* value of state variable */
{
switch(Code)
{
case XY_IDLE:
printf("XY_IDLE");
break;
case TX_START:
printf("TX_START");
break;
case TX_NEWFILE:
printf("TX_NEWFILE");
break;
case TX_WAIT4_NCG:
printf("TX_WAIT4_NCG");
break;
case TX_COMPUTE_PACKETS:
printf("TX_COMPUTE_PACKETS");
break;
case TX_READ_DISK:
printf("TX_READ_DISK");
break;
case TX_SEND_EOT:
printf("TX_SEND_EOT");
break;
case TX_WAIT4_EOT_ACK:
printf("TX_WAIT4_EOT_ACK");
break;
case TX_PREPARE_PACKET:
printf("TX_PREPARE_PACKET");
break;
case TX_SEND_PACKET:
printf("TX_SEND_PACKET");
break;
case TX_SEND_DATA:
printf("TX_SEND_DATA");
break;
case TX_SEND_CHECKSUM:
printf("TX_SEND_CHECKSUM");
break;
case TX_WAIT4_PACKET_ACK:
printf("TX_WAIT4_PACKET_ACK");
break;
case TX_CHECK4_RESTART:
printf("TX_CHECK4_RESTART");
break;
case TX_NEXT_PACKET:
printf("TX_NEXT_PACKET");
break;
case RX_START:
printf("RX_START");
break;
case RX_SEND_NCG:
printf("RX_SEND_NCG");
break;
case RX_WAIT4_INCOMING:
printf("RX_WAITING4_INCOMING");
break;
case RX_OPEN_FILE:
printf("RX_OPEN_FILE");
break;
case RX_READY4_PACKETS:
printf("RX_READY4_PACKETS");
break;
case RX_GET_PACKET:
printf("RX_GET_PACKET");
break;
case RX_PACKET_OK:
printf("RX_PACKET_OK");
break;
case RX_WAIT4_SOH_STX:
printf("RX_WAIT4_SOH_STX");
break;
case RX_GET_DATA:
printf("RX_GET_DATA");
break;
case RX_GET_PACKET_NBR:
printf("RX_GET_PACKET_NBR");
break;
case RX_GET_COMPLIMENT:
printf("RX_GET_COMPLIMENT");
break;
case RX_GET_CRC:
printf("RX_GET_CRC");
break;
case RX_GET_2ND_CRC:
printf("RX_GET_2ND_CRC");
break;
case RX_TEST_CRC:
printf("RX_TEST_CRC");
break;
default:
printf("Unknown state = %d\n",Code);
break;
} /* end switch */
return(0);
} /* end xySayState */